#include <gtest\gtest.h>

#include "gr_algorithms.h"
#include "gr_texttools.h"

#include<cstring>

namespace {

TEST(testStringMatch, testSimpleMatching)
{
    std::map<int, std::string> map;
    map[0] = "zero";
    map[1] = "one";
    map[2] = "two";

    auto match = gr::makeMatch(map);
    auto mk = [](const char* s)->std::string{return std::string(s);};

    const int n = 3;
    int t[n];
    bool f[n];

    std::string s[] = {mk("zero or more"), mk("  one("), mk("are twofold")};
    for(int i = 0; i < n; ++i)
    {
            f[i] = match(s[i], t[i]);
    }

}
} // namespace

int main(int argc, char **argv) {
  ::testing::InitGoogleTest(&argc, argv);
  return RUN_ALL_TESTS();
}


#if 0
int main(int argc, char* argv[])
{
    for(auto t = g_tests.begin(); t != g_tests.end(); t++)
    {
        auto testCase = (*t)();
        if(!testCase->run())
        {
            logError(testCase);
        }
        delete testCase;
    }


    return 0;
}
#endif